package com.xcw.test;

import com.xcw.util.SmallTool;

import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.concurrent.CompletableFuture;

/**
 * @Author bhx
 * @Date 2022/7/19 1:49
 * @Description TODO
 */
public class MainTestCompletableFuture_1 {
    public static void main(String[] args) {
//        SmallTool.printTimeAndThread("小白进入餐厅");
//        SmallTool.printTimeAndThread("小白点餐：牛肉饭");
//        CompletableFuture<String> completableFuture = CompletableFuture.supplyAsync(()->{
//            SmallTool.printTimeAndThread("厨师炒菜");
//            SmallTool.sleepMills(1000L);
//            SmallTool.printTimeAndThread("厨师上盘");
//            SmallTool.sleepMills(2000L);
//            SmallTool.printTimeAndThread("厨师完成！");
//            SmallTool.printTimeAndThread("小白吃菜！");
//            return "饭做好了！！";
//        });
//        SmallTool.printTimeAndThread("小白付钱");
//        SmallTool.printTimeAndThread(String.format("小白离开餐厅",completableFuture.join()));
        LocalDateTime l1 = LocalDateTime.now();

        long aLong = l1.toInstant(ZoneOffset.of("+8")).toEpochMilli();
        System.out.println(l1);
    }
}
